#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'

#define REP(i, x, y) for (auto i = (x), _##i = (y); i < _##i; ++i)
#define PER(i, x, y) for (auto i = (x), _##i = (y); i > _##i; --i)

int a[11] = {0, 1,};
int book[20];
int target = 9;
int flag = 0;

void fill() {
    a[1] = 1;
    for (int i = 2; i <= 10; i++)
        a[i] = a[i - 1] * i;
}

void dfs(int k) {
    if (flag == 1)return;
    if (k > 10) {
        if (inner_product(a + 1, a + k + 1, book + 1, 0) == target) {
            flag = 1;
            copy(book + 1, book + k + 1, ostream_iterator<int>(cerr, ""));
            cerr << endl;
        }
        return;
    }
    book[k] = 0;
    dfs(k + 1);
    book[k] = 1;
    dfs(k + 1);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    fill();
    while (cin >> target) {
        flag = 0;
        fill(book, book + 20, 0);
        dfs(1);
        if (flag) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }

    return 0;
}
